import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'm-wizard-stepper',
  templateUrl: './wizard-stepper.component.html',
  styleUrls: ['./wizard-stepper.component.scss'],
})
export class WizardStepperComponent implements OnInit {
  constructor() {}
  @Input() dataSource: Step[];
  @Input() value: number;
  @Output() valueChange = new EventEmitter<number>();

  // 子步骤
  @Input() child: number;
  @Output() childChange = new EventEmitter<number>();
  @Input() sm: boolean;

  ngOnInit() {}

  goto(value: number, child = 0) {
    this.valueChange.emit(value);
    this.childChange.emit(child);
  }
}
export interface Step {
  title: string;
  invalid?: boolean;
  children?: Step[];
}
